import request from '@/utils/request'

export function getQuestionList(limit, page, params) {
  return request({
    url: `question/find/${limit}/${page}`,
    method: 'get',
    params
  })
}

export function addQuestion(data) {
  return request({
    url: 'question/add',
    method: 'POST',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data
  })
}

export function changeQuestion(qid, data) {
  return request({
    url: `question/alter/${qid}`,
    method: 'POST',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data
  })
}

export function deleteQuestion(qid) {
  return request({
    url: `question/delete/${qid}`,
    method: 'DELETE'
  })
}
